// generated 2005/10/14 21:24:48 CST by xihe@xh1999.(none)

#ifndef _FINDBUDDYWINDOW_GLADE_HH
#  define _FINDBUDDYWINDOW_GLADE_HH


#if !defined(GLADEMM_DATA)
#define GLADEMM_DATA 
#include <gtkmm/accelgroup.h>

class GlademmData
{  

    Glib::RefPtr<Gtk::AccelGroup> accgrp;
    public:

    GlademmData(Glib::RefPtr<Gtk::AccelGroup> ag) : accgrp(ag)
    {  
    }

    Glib::RefPtr<Gtk::AccelGroup>  getAccelGroup()
    {  return accgrp;
    }
};
#endif //GLADEMM_DATA

#include <gtkmm/window.h>
#include <gtkmm/radiobutton.h>
#include <gtkmm/entry.h>
#include <gtkmm/checkbutton.h>
#include <gtkmm/comboboxentry.h>
#include <gtkmm/combobox.h>
#include <gtkmm/label.h>
#include <gtkmm/treeview.h>
#include <gtkmm/button.h>
#include <gtkmm/notebook.h>
#include <gtkmm/liststore.h>
class SearchUserPacket;
class SearchUserReplyPacket;
class QQSession;
class FindBuddyWindow: public Gtk::Window
{  
    public:
	FindBuddyWindow(QQSession* _session);
	~FindBuddyWindow();

	void setSession(QQSession* _session) { session = _session; }
	void on_RecvResult(QQSession & session);

    private:
	void on_buttonPrev_clicked();
	void on_buttonNext_clicked();
	void on_buttonClose_clicked();
	bool on_delete_event(GdkEventAny*);

	void showFriendResultPage(int findtype);
	void showClusterResultPage();

	void initalize();

    private:
	
	struct FriendResultColumns : public Gtk::TreeModel::ColumnRecord {
	    FriendResultColumns() 
	    {
		add(Face);
		add(Uid);
		add(Nickname); 
		add(Province);
	    }
	    Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf> > Face;
	    Gtk::TreeModelColumn<Glib::ustring> Uid;
	    Gtk::TreeModelColumn<Glib::ustring> Nickname;
	    Gtk::TreeModelColumn<Glib::ustring> Province;
	};

	struct ClusterResultColumns : public Gtk::TreeModel::ColumnRecord {
	    ClusterResultColumns()
	    {
		add(Face);
		add(Uid);
		add(Nickname);
		add(Creator);
	    }
	    Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf> > Face;
	    Gtk::TreeModelColumn<Glib::ustring> Uid;
	    Gtk::TreeModelColumn<Glib::ustring> Nickname;
	    Gtk::TreeModelColumn<Glib::ustring> Creator;
	};
	
	FriendResultColumns	friendResultColumns;
	ClusterResultColumns	clusterResultColumns;
	Glib::RefPtr<Gtk::ListStore> friendResultList;
	Glib::RefPtr<Gtk::ListStore> clusterResultList;
	QQSession*	session;
	GlademmData*	gmm_data;
	int		currentFind;//用来识别当前在用什么方式查找
    
	class Gtk::Notebook* notebookFind;
	class Gtk::RadioButton * radiobuttonFindBuddy;
	class Gtk::RadioButton * radiobuttonFindCluster;
	class Gtk::RadioButton * radiobuttonFindOnline;
	class Gtk::RadioButton * radiobuttonPreciseFind;
	class Gtk::RadioButton * radiobuttonAdvancedFind;
	class Gtk::Entry * entryUid;
	class Gtk::Entry * entryNickname;
	class Gtk::Entry * entryEmail;
	class Gtk::CheckButton * checkbuttonAdvancedFindOnline;
	class Gtk::CheckButton * checkbuttonAdvancedFindVideo;
	class Gtk::ComboBoxEntry * comboboxentryCity;
	class Gtk::ComboBox * comboboxAge;
	class Gtk::ComboBox * comboboxSex;
	class Gtk::ComboBoxEntry * comboboxentryProvince;
	class Gtk::Label * labelProvince;
	class Gtk::Entry * entryClusterId;
	
	class Gtk::TreeView * treeviewFriendResult;
	class Gtk::Button * buttonAllFriendResult;
	class Gtk::Button * buttonDetailedFriendResult;
	class Gtk::Button * buttonPrevFriendResult;
	class Gtk::Button * buttonNextFriendResult;
	class Gtk::Button * buttonAddFriendResult;
	
	class Gtk::TreeView * treeviewClusterResult;
	class Gtk::Button   * buttonDetailedClusterResult;
	class Gtk::Button * buttonAddClusterResult;

	class Gtk::Button * buttonPrev;
	class Gtk::Button * buttonNext;
	class Gtk::Button * buttonClose;
};
#endif
